package 设计模式.状态设计模式;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("开始下单");
        Order order = new Order();
        order.setSno(7777L);
        order.setGoodId(100L);
        Thread.sleep(2000);
        System.out.println("下单完成");
        System.out.println(order.getState());
        System.out.println("支付中...");
        Thread.sleep(3000);
        System.out.println("支付完成");
        order.nextState();
        System.out.println(order.getState());
        System.out.println("正在配送...");
        Thread.sleep(4000);
        System.out.println("配送完成");
        order.nextState();
        System.out.println(order.getState());
    }
}
